{include file="public/account_head"}
<div class="pub_wid notice_cont">
    <div class="mes_left rg" id="resetPassword">
        <div class="message bgb widthauto radius">
            <h6>账户信息</h6>
            <div class="widthauto">
                <ul class="att_box widthauto" id="password">
                    <li><span>原密码：</span>
                        <input v-model="password" name="" type="text" class="bai" placeholder="请输入原密码"/>
                    </li>
                    <li><span>新密码：</span>
                        <input v-model="newPassword" name="" type="text" class="bai" placeholder="请输入新密码"/>
                    </li>
                    <li><span>确认密码：</span>
                        <input v-model="anewPassword" name="" type="text" class="bai" placeholder="请再次输入新密码"/>
                    </li>
                </ul>
                <div class="submit"><a @click="resetPassword()">提交修改</a></div>
            </div>
        </div>
    </div>
    <div class="lf two_left">
        <div class="about_nav">
            <ul class="widthauto">
                <li><a href="#" class="down" >账户中心</a></li>
                <p class="widthauto">
                    <a href="/index/consignor/index">我的信息</a>
                    <a href="/index/consignor/reset" class="cur">修改密码</a>
                </p>
                <li>
                    <a href="/index/consignor/facilitator" >运力服务商</a>
                </li>
                <li>
                    <a href="/index/consignor/noticeList">我的发布</a>
                </li>
            </ul>
        </div>
        <div class="add_box"> <a href="#"><img src="/static/index/public/images/add_008.jpg" /></a> </div>
    </div>
</div>
{include file="public/footer"}
<script>
    var resetPasswordVm = new Vue({
        el:'#resetPassword',
        data:{
            password:'',
            newPassword:'',
            anewPassword:'',
            member_id:''
        },
        methods:{
            resetPassword:function () {
                var el = this
                var postData = {
                    "password":el.password,
                    "newPassword":el.newPassword,
                    "anewPassword":el.anewPassword,
                    'member_id':el.member_id
                }
                AjaxPost(postData,'/index/member/resetPassword').then((response)=>{
                    if(response.status == 1){
                        $.customToastr('success',response.message)
                        setTimeout(()=>{
                            AjaxPostFree('/index/member/memberLogout').then((response)=>{
                                console.log(response)
                                localStorage.clear()
                                window.location.href='/index/member/login'
                            })
                        },1000)

                    }

                })
            }
        },
        mounted(){
            this.$nextTick(function () {
                if(localStorage.getItem('member_category')){
                    this.member_id = localStorage.getItem('memberId')
                }
            })
        }
    })
</script>